package me.notreally.incoming;

import java.io.File;

/**
 * @author caduffy
 * Targets carry information about the file to be critiqued and acted upon
 */

public class Target extends File{
	//Serializable.
	private static final long serialVersionUID = 1L;

	//Targets have workingDirectories, used to identify their config file
	File workingDirectory;
	File configFile;

	public Target(String fullPath) throws Exception {
		super(fullPath);
		
		//Targets that don't exist are invalid. 
		if(!exists()){
			throw new Exception("Path is invalid");	
		}
		
		//Is it a File? Targets are individual files, not dirs.
		if(!isFile()){
			throw new Exception("Target is not a file");
		}
		
		//Can't read it? Not for us.
		if(!canRead()){
			throw new Exception("File is not readable");
		}
		
		//Can't write it? Likely shouldn't touch it.
		if(!canWrite()){
			throw new Exception("File is not writable");
		}
						
		//We have a valid Target. Set it up.
		
		
		
	}
	
	
	public Long getFileSize(){
		//We have this method here in case we need to mutate file lengths in the future
		//Convert to k, whatever.
		return length();
	}
	


}
